<template>
	<view class="h-170 w-p-100 border-box round-8 mt-15 flex flex-center" @click="upload">
		<image :src="props.modelValue" v-if="props.modelValue" class="h-120" mode="heightFix" />
		<image src="@/static/icon/add.png" class="w-50 h-50" v-else />
	</view>
</template>

<script setup>
	const emit = defineEmits(['update:modelValue'])
	const props = defineProps({
		modelValue: {
			default: '',
			type: String
		}
	})
	const upload = () => {
		uni.chooseImage({
			count: 1,
			success(res) {
				emit('update:modelValue', res.tempFilePaths[0])
			}
		})
	}
</script>

<style>
</style>